home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Back to Campus
/
Back to Campus - Computer Life (Ziff-Davis)(1995).ISO
/
shgmdemo
/
install
/
inst.mst
< prev
next >
Wrap
Text File
|
1995-05-01
|
47KB
|
1,389 lines
'**************************************************************************
'* MS Test script for Win32s, WinG, and Shanghai Great Moments
'**************************************************************************
''$DEFINE DEBUG ''Define for script development/debugging
''XXX
''$define MYDEBUG '' define for script development'
'$INCLUDE 'setupapi.inc'
'$INCLUDE 'msdetect.inc'
'*-------------------------------[ Constants ]------------------------------*'
const MIN_DRIVE_SPACE = 12000000 '' 12 megs
const LOGO = 1 ''Bitmap ID
const InfFile$ = "shgm.inf" '
const ErrStr$ = "**** ERROR ****: "
const CUIDLL$ = "mscuistf.dll"
const hlpOFFSET = 10 '' add to dialog ID to get help dlg ID
const verNOT_EXIST = 0
const verIS_OLDER = 1
const verINCOMPLETE = 2
const verSAME_BUT_MISSING = 3
const verSAME_AND_VALID = 4
const verIS_NEWER = 5
'*-------------------------------[ Dialog IDs ]-----------------------------*'
const dlgWELCOME = 100 '' Welcome dialog box
const hlpWELCOME = 110 '' Help msgbox for welcome dialog
const dlgASKQUIT = 200 '' Confirm quit install dialog
''Finished! dialog boxes
''
const EXITSUCCESS = 700 '' Successful install msgbox
const dlgOK_NEED_W32S_WING = 710 '' Install ok, but still need WinG/W32s
const dlgOK_NEED_W32S = 720 '' Install ok, but still need W32s
const dlgOK_NEED_WING = 730 '' Install ok, but still need WinG
'' Final dialog boxes
''
const dlgRESTART_MUST = 740
const dlgRESTART_PLEASE = 750
const dlgBADDISKSPACE = 10000 '' insufficient space on disk
const dlgBADDISKSPACEEXT = 10010 '' insufficient space on disk for
'' extensions
const dlgBADPATH = 10100 '' bad path msgbox
const dlgBADDRIVE = 10110 '' bad drive msgbox
'' Status dialog boxes
const dlgSCANW32S = 300 '' Checking for Win32s files
const dlgSCANWING = 301 '' Checking for WinG files
const dlgCHECKSPACE = 350 '' Checking disk space
'' Notify install/skip-install dialogs
''
const dlgW32S = 5000
const dlgWING = 5100
const dlgSHGM = 5200 '' this one asks for destination path
const dlgNO_SHARE = 1330 ''
const hlpNO_SHARE = 1010 '' Help msgbox for no-share warning
'' Confirmation dialog boxes
''
const dlgCONFIRM_OVER_W32S = 2000
const dlgCONFIRM_OVER_WING = 2010
const dlgCONFIRM_SKIP_W32S = 2100
const dlgCONFIRM_SKIP_WING = 2110
'' Install failure codes that also correspond to dialog msgbox id numbers
''
const exitFAILURE = 400 '' generic Failure msgbox
const exitFAILW32S = 410 '' Win32s install failure
const exitFAILWING = 420 '' WinG install failure
const exitFAILSHGM = 430 '' SHGM install failure
const exitQUIT = 600 '' User quit install msgbox
'' System config errors that cause install failure
''
const sysfailNOTWIN31 = 1200 ''
const sysfailNOTENH = 1300 '' Not enhanced mode Win3.1x failure
const sysfailNOTPAGING = 1325 '' No VM enabled failure
const sysfailNOTINTEL = 1350
const sysFAILRUNAPP = 1360 '' Win32s failure (Win32s active)
const sysfailNT31 = 1365 '' version of NT was less than 3.5
const sysfail256COLOR = 1370 '' 256 color mode not detected
const verSKU$ = "SKU" '' Main SKU
const verPOP$ = "POP" '' POP demo
const verCVR$ = "CVR" '' Cover demo
'*------------------------------[ Misc Globals ]----------------------------*'
global driveWinSys$ '' Drive Windows is on
global dirWinSys$ '' Windows\System directory.
global dirWinSysWin32s$ '' Windows\System\Win32s directory
global dirSHGM$ '' SHGM destination directory
global SrcDir$ '' Source directory (where the .INF file is)
'' status flags
global onWin31% '' 0 = not 3.1x, 1 = on Win3.1x
global win32Enabled% '' 0 = not enabled, 1 = enabled
global prevW32s% '' set to one of the ver?????? constants
global prevWinG% '' set to one of the ver?????? constants
global szW32OldVer$
global boolLog% '' 0 = logfile closed, 1 = logfile open
global instVers$
'*-------------------------------[ Prototypes ]-----------------------------*'
declare sub InstallWin32sFiles
declare sub InstallWinGFiles
declare sub InstallSHGMFiles
declare function RebootSystem AS INTEGER
declare function MakePath (szDir$, szFile$) AS STRING
declare sub dputs(arg1$) '' print string to logfile or debug screen with '\n'
declare sub W32SAddToCopyList
declare sub WINGAddToCopyList
declare sub SHGMAddToCopyList
declare function InstallVFlatD as integer
declare function DoesSectionFilesExist(szSection$,szDirPath$,dlgID%) as integer
declare function Have256Colors as integer
declare function ConfirmDialog(dlgID%) as integer
'*-------------------------[ External DLL functions ]-----------------------*'
'$ifdef MYDEBUG
declare function OutputDebugString LIB "KRNL386.EXE" (arg1$) as integer
'$endif
declare function OnWindowsNT LIB "INIUPD.DLL" AS INTEGER
declare function PagingEnabled LIB "INIUPD.DLL" AS INTEGER
declare function ShareEnabled LIB "INIUPD.DLL" AS INTEGER
declare function IsWin32sLoaded LIB "INIUPD.DLL" (arg1$) AS INTEGER
declare function IsRunningApp LIB "INIUPD.DLL" AS INTEGER
declare function SetCuiFlags LIB "MSCUISTF.DLL" (arg1%, arg2%) AS INTEGER
declare function ExitWindowsExec LIB "USER.EXE" (arg1$, arg2$) AS INTEGER
'' WinG stuff
declare function VflatdPresent LIB "setuphlp.DLL" AS INTEGER
declare function RestartWindows LIB "setuphlp.DLL" AS INTEGER
''declare function OnWin3x LIB "setuphlp.DLL" AS INTEGER
''declare function GetRealSystemDir LIB "setuphlp.DLL" (szDir$,cbBuf%) AS INTEGER
''declare function IsWin32FileNewer LIB "setuphlp.DLL" (szOrig$,szNew$) AS INTEGER
''declare sub RenameFilePlease LIB "setuphlp.DLL" (szOrig$,szNew$)
'' Custom stuff in UTILS.DLL to update SYSTEM.INI
declare function UpdateIniW32S LIB "utils.dll" as integer
declare function UpdateIniWING LIB "utils.dll" as integer
'*----------------------------[ Start of script ]---------------------------*'
INIT:
HELPPROC$ = "FHelpDlgProc" '' Help dialog procedure
szW32OldVer$ = "1.00.000 " '' Reserve space in string for version
'' bools
onWin31% = 0
win32Enabled% = 0
'' flags to indicate existence or previous versions
prevW32s% = ver_NOT_EXIST
prevWinG% = ver_NOT_EXIST
okW32S% = 0
okWING% = 0
okSHGM% = 0
instW32S% = 0
instWING% = 0
instSHGM% = 0
doAddDVA% = 0
warnNeedW32S% = 0
warnNeedWING% = 0
systemIniBackedUp% = 0
ON ERROR goto ERRNORMAL
'' Read in the .INF file
''
SrcDir$ = GetSymbolValue("STF_SRCDIR")
szInf$ = GetSymbolValue("STF_SRCINFPATH")
if szInf$ = "" then
szInf$ = GetSymbolValue("STF_CWDDIR") + InfFile$
endif
ReadInfFile szInf$
'' Setup a pretty looking screen :)
''
SetBitmap CUIDLL$, LOGO
SetTitle "Shanghai: Great Moments Setup"
'' Determine install type
instVers$ = GetSymbolValue("VER_INSTALL")
'' Determine install directories
''
dirWinSys$ = GetWindowsSysDir()
dirWinSysWin32s$ = dirWinSys$ + "WIN32S\"
driveWinSys$ = MID$(GetWindowsDir, 1, 1)
driveNeeds$ = "DriveNeeds"
'$IFDEF DEBUG
i% = SetSizeCheckMode(scmOnIgnore) '' could use scmOff; def = scmOnFatal
driveWinSys$ = MID$(GetWindowsDir, 1, 1)